layui.use(['table'], function () {
    var table = layui.table;

    /**
     * 套餐资费--可订购资费
     */
    var ToOrderedCharges = {
        tableId: "toOrderedChargesTable",    //表格id
    };

    /**
     * 初始化表格的列
     */
    ToOrderedCharges.initColumn = function () {
        return [[
            {field: 'offeringId', align: "center", title: '资费ID'},
            {field: 'offeringName', align: "center", title: '资费名称'},
            {field: 'offeringType', align: "center", title: '资费分类'},
            {field: 'paymentMode', align: "center", title: '付费模式'},
            {field: 'effetiveDate', align: "center", title: '生效时间'},
            {field: 'expiriedDate', align: "center", title: '失效时间'},
            {field: 'description', align: "center", title: '资费描述'},
            {field: 'childOfferId', align: "center", title: '子资费ID'},
            {field: 'childOfferName', align: "center", title: '子资费名称'},
            {field: 'childEffetiveDate', align: "center", title: '子资费生效时间'},
            {field: 'childExpiriedDate', align: "center", title: '子资费失效时间'}
        ]];
    };

    // 渲染表格
    table.render({
        elem: '#' + ToOrderedCharges.tableId,
        url: Feng.ctxPath + '/orderedCharges/query?accountId='+ $("#accountId").val() + '&status=' + $("#status").val()
            + '&groupId=' + $("#groupId").val()+ '&msisdn=' + $("#msisdn").val()+ '&catalogId=' + $("#catalogId").val()
            + '&categoryId=' + $("#categoryId").val(),
        height: "full-98",
        page: {
            prev: "上一页",
            next: "下一页",
            layout: ['prev', 'next'],
            limit: 10
        },
        cellMinWidth: 100,
        cols: ToOrderedCharges.initColumn()
    });
});